﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Employee
{
    class HourlyWorker : Employee
    {
        private int rate;
        private int hours;
        private int salary;

        public HourlyWorker(int rate, int hours, string name) : base(name)
        {
            if (rate == 0 || hours == 0)
                throw new ArgumentNullException("rate or hours are empty");
            else
                this.hours = hours;
                this.rate = rate;
        }

        public override void CalculateSalary()
        {
            salary = rate * hours;
        }

        public override void PrintToConsole()
        {
            Console.WriteLine("{0} - month salary: ${1}", name, salary);
        }


    }
}
